<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<link rel="stylesheet" href="../resource/css/alink.css" type="text/css"></link>
<link rel="stylesheet" href="../resource/css/common.css" type="text/css"></link>
     <s:include value="../resource/JsAndstyle.jsp"></s:include>
<script type="text/javascript">
	function checkIdentityCard(){
		var obj=document.getElementById("idIdentityCard");
		var span=document.getElementById("errorIdentityCard");
		if(obj.value == "" || obj.value.trim().length==0){
			span.innerHTML = "身份证号码不能为空";
			return false;
		}else{
			span.innerHTML = "";
			return true;
		}
	}
	function checkRealName(){
		var obj=document.getElementById("idRealName");
		var span=document.getElementById("errorRealName");
		if(obj.value == "" || obj.value.trim().length==0){
			span.innerHTML = "教师姓名不能为空";
			return false;
		}else{
			span.innerHTML = "";
			return true;
		}
	}
	function checkLoginName(){
		var obj=document.getElementById("idLoginName");
		var span=document.getElementById("errorLoginName");
		if(obj.value == "" || obj.value.trim().length==0){
			span.innerHTML = "登陆账号不能为空";
			return false;
		}else{
			span.innerHTML = "";
			return true;
			}
	}
	function checkPassword(){
		var obj=document.getElementById("idPassword");
		var span=document.getElementById("errorPassword");
		if(obj.value == "" || obj.value.trim().length==0){
			span.innerHTML = "登陆密码不能为空";
			return false;
		}else{
			span.innerHTML = "";
			return true;
			}
	}
	function checkAll(){
		var res =  checkIdentityCard() & checkRealName() & checkLoginName()&checkPassword();
		return (res == 1);
	}
</script>
</head>

<body>
	<table class="right_top" cellpadding="0" cellspacing="0">
		<tr>
			<td class="right_top_left"></td>
			<td class="right_top_center">当前位置：添加教师账号</td>
			<td class="right_top_center" style="width:70px;">&nbsp;</td>
			<td class="right_top_right"></td>
		</tr>
	</table>

	<table class="right_middle" cellspacing="0" cellpadding="0">
		<tr>
			<td style="height:27px;"><p></p></td>
		</tr>
		<tr>
			<td style="vertical-align:top; padding:3px;"><table width="500"
					cellpadding="0" cellspacing="1" class="tableList">
					<tr>
						<th colspan="2"><table width="98%" border="0" cellspacing="0"
								cellpadding="0">
								<tr>
									<td height="27" align="left">&nbsp;&nbsp;添加教师账号</td>
									<td align="right">&nbsp;</td>
								</tr>
							</table></th>
					</tr>
					<tr class="trListOdd">
						<td width="200" align="center" valign="top" bgcolor="#F6FBFB"><p>&nbsp;</p>
						</td>
						<td valign="top"><p>&nbsp;</p> 
						<s:form action="/school/teacherAddAction!add" 
								method="post" onsubmit="return checkAll();">
								<table cellspacing="0" cellpadding="0"
									style="text-align:left; width:98%; border:none;">
									<tr>
										<td width="50" height="30">&nbsp;</td>
										<td width="150">身份证号码</td>
										<td width="320"><s:textfield name="teacher.identityCard"
												id="idIdentityCard" onblur="checkIdentityCard()" /><span
											id="errorIdentityCard" style="color:red;font-size:13px;"></span>
										</td>
										<td><s:fielderror cssClass="error-tip"
												fieldName="teacher.identityCard" /></td>
									</tr>
									<tr>
										<td width="50" height="30">&nbsp;</td>
										<td width="150">教师姓名</td>
										<td width="320"><s:textfield name="teacher.realName"
												id="idRealName" onblur="checkRealName()" /><span
											id="errorRealName" style="color:red;font-size:13px;"></span>
										</td>
										<td><s:fielderror cssClass="error-tip"
												fieldName="teacher.realName" /></td>
									</tr>
									<tr>
										<td height="30">&nbsp;</td>
										<td>登录账号</td>
										<td><s:textfield name="loginUser.loginName" id="idLoginName"
												onblur="checkLoginName()" /><span id="errorLoginName"
											style="color:red;font-size:13px;"></span></td>
										<td><s:fielderror cssClass="error-tip"
												fieldName="login.loginName" /></td>
									</tr>
									<tr>
										<td height="30">&nbsp;</td>
										<td>登陆密码</td>
										<td><s:textfield name="loginUser.loginPassword" id="idPassword"
												onblur="checkPassword()" /><span id="errorPassword"
											style="color:red;font-size:13px;"></span></td>
										<td><s:fielderror cssClass="error-tip"
												fieldName="password" /></td>
									</tr>
									<tr>
										<td height="30">&nbsp;</td>
										<td>&nbsp;</td>
										<td><s:submit value="提交" cssClass="input_btn" /></td>
										<td></td>
									</tr>
									<tr>
										<td height="30">&nbsp;</td>
										<td>&nbsp;</td>
										<td><s:actionerror />
										</td>
										<td>&nbsp;</td>
									</tr>
								</table>
							</s:form></td>
					</tr>
				</table></td>
		</tr>
	</table>
</body>
</html>